package com.lmq.strategy.demo02;


public class StrategyTest {
    public static void main(String[] args) {
        NormalZombie normalZombie = new NormalZombie();
        normalZombie.display();
        normalZombie.attack();
        normalZombie.move();
        normalZombie.setAttackable(new HitAttack());
        normalZombie.attack();
//        Arrays.sort();

    }

    /*
    sort(T[] a,Comparable)对数组排序函数用到了策略模式
        public static <T> void sort(T[] a, Comparator<? super T> c) {
        if (c == null) {
            sort(a);
        } else {
            if (LegacyMergeSort.userRequested)
                legacyMergeSort(a, c);
            else
                TimSort.sort(a, 0, a.length, c, null, 0, 0);
        }
    }
     */
}
